﻿using System.Linq;
using JetBrains.ReSharper.Psi.CSharp.Tree;
using Twins.Infrastructure;
using Twins.Interface;
using Twins.Interface.IProcesser;

namespace Twins.Classes.Hanlder
{
    public class ReceiveHashLineCodeFromProcesserCSharpExpression : IReceiveHashLineCodeFromProcesserCSharpExpression
    {
        public void ReceiveHashLineCode(ICSharpExpression cSharpExpression, ref string hashLineCode)
        {
            var processerCSharpExpression = IoC.Resolve<IProcesser>("ProcesserCSharpExpression");
            var lineCodes = processerCSharpExpression.DoSomethingWith(cSharpExpression);
            if (lineCodes != null)
                hashLineCode += lineCodes.FirstOrDefault().HashLineCode;
        }
    }
}